#include <iostream>
#include <boost/asio.hpp>
#include "Object.h"
#include "Network.h"

using boost::asio::ip::udp;

int main( int argc, char** argv)
{
	try 
	{
		Object::init(true);
		char *receiver = "10.40.31.105";
		Network::addReceiverEndpoint(Network::getEndpoint(receiver));
		ObjectMessage *object = Object::createObject();
		while (true) {
			Object::sendMessage(object);
			boost::posix_time::seconds waitTime(0.1f);
			boost::this_thread::sleep( waitTime );
//			std::cout << "frame: " << frame++ << std::endl;
		}
	} 
	catch (std::exception& e) 
	{
		std::cerr << e.what() << std::endl;
	}

	return 0;
}
